	# Object/Debuggable.pm
	package Object::Debuggable;
	use strict;
	no strict 'refs';
	
	# constructor - for new objects
	sub new {
	   my ($self, $level) = @_;
	   my $class = (ref $self) || $self;
	
	   $self = bless {}, $class;
	   $self->initialize($level);
	
	   return $self;
	}
	
	# initializer - for existing objects
	sub initialize {
	   my ($self, $level) = @_;
	   $self->{'debug_level'} = $level;
	}
	
	# accessor/mutator 
	sub debug_level {
	   my ($self, $level) = @_;
	
	   if (defined $level) {
	      my $oldlevel = $self->{'debug_level'};
	      $self->{'debug_level'} = $level;
	      return $oldlevel;
	   }
	
	   return $self->{'debug_level'};
	}
	
	# debug method
	sub debug {
	   my ($self, $level) = (shift, shift);
	   print STDERR @_, "\n" if $level <= $self->{'debug_level'};
	}
	
	1;
